package com.ParkingManager.app.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Objects;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ParkingManager.app.bean.User;
import com.ParkingManager.app.dao.UserMapper;
import com.ParkingManager.app.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserMapper mapper;

	public List<HashMap> getUser() {
		return mapper.getUser();
	}

	// 登录
	public int login(User user){
		return mapper.login(user);
	}


	public boolean insertUser(String userName,String password,int userType, String parkingId) {
		// TODO Auto-generated method stub
		return mapper.insertUser(userName, password, userType, parkingId);
	}


	public boolean updateUser(String userName, String parkingId) {
		// TODO Auto-generated method stub
		return mapper.updateUser(userName,  parkingId);
	}


	public boolean deleteUser(String userName) {
		// TODO Auto-generated method stub
		return mapper.deleteUser(userName);
	}


	public int getCountUser() {
		// TODO Auto-generated method stub
		return mapper.getCountUser();
	}


	public List<HashMap<String,Object>> searchByPname(String pName) {
		// TODO Auto-generated method stub
		return mapper.searchByPname(pName);
	}


	public List<HashMap<String,Object>> searchByPid(int pid) {
		// TODO Auto-generated method stub
		return mapper.searchByPid(pid);
	}


	public List<HashMap<String,Object>> searchByUser(String uName) {
		// TODO Auto-generated method stub
		return mapper.searchByUser(uName);
	}

}
